﻿ @inherits AdminCompontentBase

 <SAutoComplete Value="Value"
               ValueChanged="async value => await UpdateValueAsync(value)"
               TValue="List<Guid>"
               TItem="StaffSelectDto"
               TItemValue="Guid"
               AutoSelectFirst
               Items="Staffs"
               OnSearchInputUpdate="QuerySelectionStaff"
               CacheItems
               Chips
               Filter="FilterItem"
               Loading="_staffLoading"
               Disabled=Readonly
               Label="@Label"
               ItemText="t=>t.DisplayName"
               ItemValue="t=>t.Id"
               Multiple
               Class="@Class">
    <SelectionContent Context="data">
        <MChip Close Style="height:28px;"
               IsActive="@data.Selected"
               OnCloseClick="()=>RemoveStaff(data.Item)">
            @if (!string.IsNullOrEmpty(data.Item.Avatar))
            {
                <MAvatar Left>
                    <MImage Src="@data.Item.Avatar"></MImage>
                </MAvatar>
            }
            <span class="body2 regular--text">
                @ReturnNotNullValue(data.Item.DisplayName,data.Item.Name)
            </span>
        </MChip>
    </SelectionContent>
    <ItemContent Context="data">
        @RenderFragments.UserSelectItem(data.Item.Avatar, data.Item.DisplayName, data.Item.JobNumber, data.Item.PhoneNumber.MaskPhoneNumber(), data.Item.Email)
    </ItemContent>
</SAutoComplete>
